import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

export default new Router({
  routes: [
    // {
    //   path: '/',
    //   name: 'HelloWorld',
    //   component: HelloWorld
    // }
    {
      path: '/',
      redirect: '/homepage'
    },
    {
      path: '/',
      component: resolve => require(['../components/common/Home.vue'], resolve),
      meta: {
        title: '自述文件'
      },
      children: [{
          path: '/homepage',
          component: resolve => require(['../components/page/calendar.vue'], resolve),
          meta: {
            title: '系统首页'
          }
        },
        {
          path: '/usercalendar',
          component: resolve => require(['../components/page/usercalendar.vue'], resolve),
          meta: {
            title: '用户打卡报表', permission: true
          }
        },
        {
          path: '/table',
          component: resolve => require(['../components/page/Dashboard.vue'], resolve),
          meta: {
            title: '导出报表', permission: true
          }
        },
        {
          path: '/advice',
          component: resolve => require(['../components/page/Dashboard.vue'], resolve),
          meta: {
            title: '意见反馈', permission: true
          }
        },{
          path: '/editpassword',
          component: resolve => require(['../components/page/updatepsw.vue'], resolve),
          meta: {
            title: '修改密码', permission: true
          }
        },
        {
          path: '/userlist',
          component: resolve => require(['../components/page/userlist.vue'], resolve),
          meta: {
            title: '人员列表', permission: true
          }
        },
        {
          path: '/upload',
          component: resolve => require(['../components/page/uploadexcel.vue'], resolve),
          meta: {
            title: '文件上传', permission: true
          }
        },
        // {
        //   path: '/icon',
        //   component: resolve => require(['../components/page/Icon.vue'], resolve),
        //   meta: {
        //     title: '自定义图标'
        //   }
        // },
        // {
        //   // 权限页面
        //   path: '/permission',
        //   component: resolve => require(['../components/page/Permission.vue'], resolve),
        //   meta: { title: '权限测试', permission: true }
        // },
        {
          path: '/404',
          component: resolve => require(['../components/page/404.vue'], resolve),
          meta: {
            title: '404'
          }
        },
        {
          path: '/403',
          component: resolve => require(['../components/page/403.vue'], resolve),
          meta: {
            title: '403'
          }
        }
      ]
    },
    {
      path: '/login',
      component: resolve => require(['../components/page/Login.vue'], resolve)
    },
    {
      path: '*',
      redirect: '/404'
    }
  ]
})
